package com.yf.exam.modules.user.cert.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 用户证书详情DTO
 */
@Data
@ApiModel("用户证书详情")
public class UserCertDetailDTO {

    @ApiModelProperty("证书记录ID")
    private String id;

    @ApiModelProperty("用户ID")
    private String userId;

    @ApiModelProperty("考试ID")
    private String examId;

    @ApiModelProperty("证书模板ID")
    private String certId;

    @ApiModelProperty("试卷ID")
    private String paperId;

    @ApiModelProperty("证书文件路径")
    private String certUrl;

    @ApiModelProperty("生成状态")
    private Integer status;

    @ApiModelProperty("生成时间")
    private Date generateTime;

    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("更新时间")
    private Date updateTime;

    // 关联信息
    @ApiModelProperty("用户姓名")
    private String userName;

    @ApiModelProperty("考试标题")
    private String examTitle;

    @ApiModelProperty("证书名称")
    private String certTitle;

    @ApiModelProperty("考试分数")
    private Double userScore;

    @ApiModelProperty("及格分数")
    private Double qualifyScore;

    @ApiModelProperty("考试时间")
    private Date examTime;

    @ApiModelProperty("状态描述")
    private String statusText;

    /**
     * 获取状态描述
     */
    public String getStatusText() {
        if (status == null) {
            return "未知";
        }
        switch (status) {
            case 0:
                return "待生成";
            case 1:
                return "生成中";
            case 2:
                return "已生成";
            case 3:
                return "生成失败";
            default:
                return "未知";
        }
    }
}